home *** CD-ROM | disk | FTP | other *** search
/ Mobiclic 51 / Mobiclic51.iso / mac / DATA / COMMUNS / MOBICLIC_MENUS.CST / 00006_Script_gestion du son < prev    next >
Text File  |  2003-01-30  |  3KB  |  114 lines

  1. -- gestion du son
  2.  
  3. global dernierSon,nivSon,volumeOn,menusActifs,ouvreVolume,  chemin, gFlag_soustitrage
  4. -- dernierSon : nom du dernier son jouΘ
  5. -- nivSon : liste α 3 termes contenant le niveau sonore de chaque piste
  6. -- volumeOn : indique si la fenΩtre de rΘglage du volume est active
  7.  
  8. -- lecture d'un son
  9.  
  10. on joueSon nom, n
  11.   global glocal_Folder
  12.   if  voidP(glocal_Folder) then exit
  13.   if the paramCount = 1 then
  14.     n = 3
  15.   end if
  16.   if voidP(nivSon)=1 then
  17.     nivSon=[255,255,255]
  18.   end if
  19.   -- ajout Θventuel de "sons:"
  20.   --  if char 1 to 9 of nom <> "sons" then
  21.   if not(nom contains "SONS") then
  22.     if offset(":", nom) = 0 then
  23.       case(the movieName.char[1..3] = "LAN") of 
  24.         1:
  25.           nom ="SONS:"& nom
  26.         0:
  27.           nom ="SONS_"& glocal_Folder&":"& nom
  28.       end case
  29.     end if
  30.   end if
  31.   dernierSon = nom
  32.   --
  33.   put the pathName & nomDos(nom) & ".aif" into temp
  34.   put "  Son jouΘ : " & dernierSon
  35.   sound playFile n, temp
  36.   -- rΘglage du niveau des autres canaux
  37.   repeat with i=1 to 3
  38.     if i<>n and nivSon[i]>110 then
  39.       sound(i).volume = 50
  40.     end if
  41.   end repeat
  42.   ---------------------------------------lancement du sous-titrage pour les sourds------------ 
  43.   if gFlag_soustitrage = 1 then gere_soustitrage(nom)
  44.   --------------------------------------------------------------------------------------------
  45. end joueSon
  46.  
  47. -- jouer un son du cyberCalendrier
  48. on sonCyber son
  49.   global gNoABS_cyber
  50.   joueson gNoABS_cyber & "_" & son
  51. end
  52.  
  53. -- rΘglage du volume
  54. on niveauSon
  55.   if voidP(nivson) = 1 then
  56.     nivson=[255,255,255]
  57.   end if
  58.   repeat with i=1 to 3
  59.     sound(i).volume = nivSon[i]
  60.   end repeat
  61. end nivSon
  62.  
  63. -- affichage de la fenΩtre de rΘglage du volume
  64. on volume
  65.   volumeOn=1
  66.   --  afficherPistes (value(field "ppgs"))
  67.   menusActifs = 0
  68.   ouvreVolume=1
  69.   --  sprite(value(field "ppgs")).memberNum = member("volumeBD").number
  70.   --  sprite(value(field "ppgs")).locH = 320
  71.   --  sprite(value(field "ppgs")).locV = 240
  72.   --  updateStage
  73.   
  74.   put "  Ouverture du rΘglage du volume"
  75. end volume
  76.  
  77. -- dissimulation de la fenΩtre de rΘglage du volume
  78. on volumeOff
  79.   --  masquerPistes (value(field "ppgs"))
  80.   --  sprite(value(field "ppgs")).memberNum = member("pointPourGlisserSur").number
  81.   menusActifs = 1
  82.   volumeOn=0
  83.   --  unloadMember member "volumeBD"
  84.   put "  Fermeture du rΘglage du volume avec les valeurs : " & nivSon
  85. end volumeOff
  86.  
  87. -- attendre la fin d'un son
  88. on attendreSon p
  89.   set T = 1.0/the frameTempo
  90.   repeat while soundBusy(p)
  91.     updateStage
  92.     temporise(T)
  93.   end repeat
  94. end
  95.  
  96. -- dΘsactivation des pistes audio
  97. on coupeSon
  98.   repeat with i=1 to the paramCount
  99.     if value(param(i))<>0 then
  100.       puppetSound (param(i)),0
  101.     else
  102.       listeSons param(i)
  103.     end if
  104.   end repeat
  105. end coupeSon
  106.  
  107. on listeSons chaine
  108.   n=offset(">", chaine)
  109.   n1=value(char 1 to n-1 of chaine)
  110.   n2=value(char n+1 to length(chaine) of chaine)
  111.   repeat with j=n1 to n2
  112.     puppetSound j,0
  113.   end repeat
  114. end listeSons